package com.itheima.socket.tcp.demo10;

import java.io.*;
import java.net.Socket;

public class ClientDemo10 {

    public static void main(String[] args) throws IOException {

        Socket socket = new Socket("192.168.19.35", 9292);
        OutputStream outputStream = socket.getOutputStream();
        BufferedInputStream bufferedInputStream = new BufferedInputStream(new FileInputStream("D:\\2019.7.30heima\\1.wmv"));

        byte[] bytes = new byte[1024];
        int len = -1;
        while ((len = bufferedInputStream.read(bytes)) != -1) {

            outputStream.write(bytes, 0, len);
        }
        bufferedInputStream.close();
        socket.close();

    }
}
